// 营销活动---查看详情
import React,{Component} from 'react'
import {Modal,Tabs} from 'antd'
import './viewdetails.css'
import Button from '../../../components/button/button'
import Collapse from '../../../components/collapse/collapse'
const TabPane = Tabs.TabPane


class ViewDetail extends Component{
  constructor(props){
    super(props)
    this.state={
      contentdisplay:true,

    }
  }
  handleCancel=()=>{
    this.props.onCancel();
  }
  render(){
    const cancelbtn={
      position:'absolute',
      right:'50px',
      bottom:'30px',
      width:'88px',
      height:'30px',
      color:'#fff',
      background: '#4C8EDB',
      borderRadius: '4px'
  }
    return(
      <Modal
        title="方案详情" className="modal_box"
        visible={this.props.show}
        footer={null}
        maskClosable={false}
        onCancel={this.props.onCancel}
        bodyStyle={{height:'700px',overflow: 'auto'}}
      >
      <div className="view_box" >
              <div style={{marginRight:"10px"}}>
                <div className="view_title">
                    <span>活动信息</span>
                </div>
                {this.props.viewdata ?
                <div className="view_mainbox" >
                  <div className="view_linedata">
                    <div>活动名称</div>
                  <div>{this.props.viewdata.activitie_name}</div>
                  </div>
                  <div className="view_linedata">
                    <div>活动描述</div>
                    <div>{this.props.viewdata.activitie_desc}</div>
                  </div>
                  <div className="view_linedata">
                    <div>适用门店</div>
                    <div>{this.props.viewdata.activitie_shop}</div>
                  </div>
                  <div className="view_linedata">
                    <div>投放时间</div>
                    <div>{`${new Date(this.props.viewdata.start * 1000).toLocaleDateString()}~${new Date(this.props.viewdata.start * 1000).toLocaleDateString()}`}</div>
                  </div>
                  <div className="view_linedata">
                    <div>创建人</div>
                    <div>{this.props.viewdata.crfeate_man}</div>
                  </div>
                  <div className="view_linedata">
                    <div>创建时间</div>
                    <div>{new Date(this.props.viewdata.created_time * 1000).toLocaleDateString()}</div>
                  </div>
                </div>
                 :false}
              </div>
                  <Collapse viewdata ={this.props.viewdata}/>
        </div>
        <Button onClick={this.handleCancel} datastyle={cancelbtn}>关闭</Button>
      </Modal>
    )
  }

}


export default ViewDetail
